package excp;


class ExTest6 {
	public static void main(String st[]){
		StudentService serv=new StudentService();
		try{
			serv.verifyUser("sri","sri");
			serv.verifyUser("manish","rahul");
		}catch (Exception e) {
			System.out.println("------");
			System.out.println(e);
		}
		System.out.println(Math.getRemainder(13,4));
		System.out.println(Math.getRemainder(13,0));
	}
}
class StudentService{
	void verifyUser(String name,String pwd){
		System.out.println("\\Interect with DB");
		if(name.equals(pwd))
			throw new InvalidUserException(name,pwd);
	}
}
class InvalidUserException extends RuntimeException{
	private String uname;
	private String pass;
	InvalidUserException(String uname,String pass){
		this.uname=uname;
		this.pass=pass;
	}
	public String getMessage(){
		return uname+","+pass;
	}
}
class Math{
	static int getRemainder(int xy,int mn){
		if(mn==0){
			throw new DivideByZeroException("Dont divide with zero");
		}
		return xy%mn;
	}
}
class DivideByZeroException extends RuntimeException{
	DivideByZeroException(String message) {
		super(message);
	}
}